#pragma once
#include "gameobject.h"
#include <vector>
#include "Math.h"

typedef std::vector<Vector2> MoveList;

class Chessman : public GameObject
{
public:
	Chessman(int x, int y, int owner);
	~Chessman(void);

	virtual void OnSelect();

	void SetSelected(bool selected);

	void SetPosition(int x, int y);

	bool IsKing() {
		return mIsKing;
	}

	int GetX() {
		return mPosX;
	}

	int GetY() {
		return mPosY;
	}

	int GetOwner() {
		return mOwner;
	}

	MoveList GetLegalMoves(Chessman* chessboard[8][8]);

private:
	void BuildMesh();
	void UpdateTransformation();

	int mPosX;
	int mPosY;
	int mOwner;
	bool mIsKing;
};
